package com.youxin.busfoundation.enums;

/**
 * 线索池添加类型来源
 * @author yingde.cao
 *
 */
public enum LeadsSourceType {	
	/**
	 * 线索池添加来源
	 */
	Search(1,"Search"),
	/**
	 * 智能推荐
	 */
	Intelligent(2,"Intelligent"),	
	;

	public int getValue() {
		return value;
	}
	
	private String name;
	
	private int value;
	private LeadsSourceType(int value,String name) {
		this.value = value;
		this.name=name;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setValue(short value) {
		this.value = value;
	}

	public static LeadsSourceType valueOf(short val)
	{			
		for(LeadsSourceType m : LeadsSourceType.values()) 
		{
			if(val==m.getValue())
				return m;
	    }
		return null;
	}
	
	public static String stringValue(Short val)
	{
		if(val==null)
		{
			return "";
		}
		LeadsSourceType status=valueOf(val);
		if(status==null)
		{
			return "";
		}
		return status.getName();
	}
	
}
